﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class UserRole : ActiveRecordBase<UserRole>
    {
		#region Const Definition
		
		public const string CONST_UserRoleID							= "UserRoleID";
		public const string CONST_EmployeeID							= "EmployeeID";
		public const string CONST_RoleID								= "RoleID";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _userRoleID;
        
        // Non Key

        // Parents
        private Employee _employeeID;
        private Role _roleID;
        
        
		

        #endregion

        public UserRole() {
               
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_USERROLE_USERROLEID")]
		#endif
        public System.Int32 UserRoleID {
            get { return this._userRoleID; }
            set {  this._userRoleID = value; }
        }
        
        // Non Key
        
        // Parent Relationships
        [BelongsTo("EmployeeID")]
        public Employee EmployeeID {
            get { return this._employeeID; }
            set { this._employeeID = value; }
        }
        
        [BelongsTo("RoleID")]
        public Role RoleID {
            get { return this._roleID; }
            set { this._roleID = value; }
        }
        
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public UserRole Clone()
		{
			UserRole newUserRole = new UserRole();
			
            newUserRole.EmployeeID = this._employeeID ; 
            newUserRole.RoleID = this._roleID ; 
			return newUserRole;
		}
    }
}



